<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="chrome=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="renderer" content="webkit">
    <meta name="author" content="yb">
    <meta name="keywords" content="关键词" />
    <meta name="description" content="描述" />
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
    <meta http-equiv="Expires" content="0">
    <!-- <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> -->
    <script src="https://cdn.bootcss.com/jquery/1.10.1/jquery.min.js"></script>
    <link rel="stylesheet" href="../style/css/base.css">
</head>
<body>
    <p>遍历数组时，两个数组内的值，对应的显示（展示两个数组中共同拥有的对象）</p>
    <p v-for="(item,index) in a" v-model="inArr(index,b)">{{item}}</p>
</body>
<script>
    $(function(){
        var a = [1,2,3,4,5,6];
        var b = [2,3];

        function inArr(index,b){
            if(b.indexOf(index) != -1){
                return true;
            }else{
                return false;
            }
        }
    })
</script>